Hi, I have been reading the forums for some time now, so about a year and a half. And always found a thread with some hints to my daily problems. But this one I got now does not once appear on the internet. So what I want to do is basically make some 3rd-Part DXL scripts available as buttons on the DOORS formal module UI. Everything seemed to work fine until my clients demanded custom icons for the buttons. The result was that either the icon appearded as "iconNone" or the button bar was broken (no DXL error), depending on what method I used to get the icon. Here are the extracts of the code I used: This code I put into ../lib/dxl/startup.dxl
//Global variables
string gstrcButtonBarName = "Tools"
Icon gicoTest = load("C:\\myTest.ico")
//Functions
Sensitivity createMyTestButtonBarCallback(){
if(toolBarVisible(current Module, gstrcButtonBarName)){
return ddbChecked
}
else{
return ddbAvailable
}
}
And this is the code I put into ../lib/dx/config/formalFiles/test.dxl
//Creating button bar
createButtonBar(gstrButtonBarName, createMyTestButtonBarCallback, false, false)
//Creating item
createItem(alwaysOn, //Mapping function
"", //label
null, //mnemonic
null, //accelerator
modKeyNone, //modifierKeyFlags
"C:\\test.ico" //iconFileName or icon_id
"CustomScript", //tooltip, text shown by mouse over
"", //helptext
"", //inactiveHelp
"C:\\CustomScript.dxl") //dxlFile
end(buttonbar)
I noticed that the DOORS standard icons with a higher id than 135 cannot be used. E.g.: //This can icon can be used as a button icon IconID icIdWorking = addr_ 135 //This cannot be used IconID icIdWorking = addr_ 182 I also found out by using the "funny doors icons" script that when I load a custom icon into memory it always gets an higher id than 135. Any workaround or fix you can provide is greatly appreciated :) Greetings, Ludwig
LucLeto - Fri May 16 10:36:32 EDT 2014 |
Re: Button bar's items cannot use custom icons? Hello Ludwig,
In order to use user specific icons you have to put those in to icons folder: "C:\Program Files (x86)\IBM\Rational\DOORS\9.5\lib\icons" and define icon file name only.
//Creating item
createItem(alwaysOn, //Mapping function
"", //label
null, //mnemonic
null, //accelerator
modKeyNone, //modifierKeyFlags
(NLS_("test.ico")) //iconFileName or icon_id
"CustomScript", //tooltip, text shown by mouse over
"", //helptext
"", //inactiveHelp
"C:\\CustomScript.dxl") //dxlFile
end(buttonbar)
Add: I've figured out that the path to the icon-file must be relative to the folder icons and it must not contain any backslashes. For an example: this will work too:
(NLS_("../dxl/addins/User/images/test.ico"))
Regards Kajto |